# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=commoncpp
pkgver=7.0.1
pkgrel=1
pkgdesc="Class framework designed for telephony applications"
url="https://www.gnu.org/software/commoncpp/"
arch="all"
license="GPL-3.0-or-later"
makedepends="cmake samurai openssl-dev>3"
subpackages="$pkgname-dev $pkgname-doc $pkgname-tools"
source="https://git.savannah.gnu.org/cgit/commoncpp.git/snapshot/commoncpp-$pkgver.tar.gz"

build() {
	cmake -G Ninja -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DBUILD_TESTING=ON
	cmake --build build
}

check() {
	cd build/test
	for test in test-*; do
		echo "Running test $test"
		./$test
	done
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

dev() {
	default_dev
	amove usr/share/ucommon
}

tools() {
	amove usr/bin
}

sha512sums="
8c16cd3bc498af13545529801213e7a1f2e19ce2a2de38887a6d85e5768d2f2aed703d56dcb1c520d0fb3df54b8f8be8ba24821ac1b8d26c31962a2806b796b7  commoncpp-7.0.1.tar.gz
"
